﻿<%@ Page Title="Repor Filters - OutDoor" Language="C#" MasterPageFile="~/user.master"
    AutoEventWireup="true" Inherits="MediaMonitor.Users.Report_Outdoor_Filter" Theme="default"
    CodeBehind="report-outdoor-filter.aspx.cs" %>  

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/Controls/AutoCompleteExtender.ascx" TagPrefix="ctrl" TagName="AutoComplete" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">
    <link href="../rad-scripts/Grid.MyCustomSkin.css" rel="stylesheet" type="text/css" />
    <link href="../rad-scripts/Input.MyCustomSkin.css" rel="stylesheet" type="text/css" />
    <link href="../rad-scripts/Menu.MyCustomSkin.css" rel="stylesheet" type="text/css" />
    <link href="../rad-scripts/slider.MyCustomSkin.css" rel="stylesheet" type="text/css" />
    <link href="../rad-scripts/Calendar.MyCustomSkin.css" rel="stylesheet" type="text/css" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <img src="file:///C:\Users\NASCEN~1\AppData\Local\Temp\ra9onmpz.bmp" />
        <script type="text/javascript">    
       
          function DateSelected(sender, eventArgs){


              var date = eventArgs.get_renderDay().get_date();
              var dfi = sender.DateTimeFormatInfo;
              var formattedDate = dfi.FormatDate(date, dfi.ShortDatePattern);
               
                 var calE = $find("<%= calE.ClientID %>");
 
                 calE.selectDate(date, true)
                   
            } 

        </script>
    </telerik:RadCodeBlock>


</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server">
 
     <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
<asp:Panel ID="pnlSearch" runat="server">

<table>
    <tr>
        <td colspan="2">
            <b>Dates</b><br /><br />
        </td>
    </tr>
    <tr>
        <td></td>
        <td>
            <table>
                <tr valign="top">
                    <td>
                        From Date
                        <br />
                        <telerik:RadCalendar AutoPostBack="false" ID="calS" runat="server" EnableMultiSelect="false"
                            ClientEvents-OnDateSelected="DateSelected">
                        </telerik:RadCalendar>
                    </td>
                    <td><div style="width:50px;"></div></td>
                    <td>
                        To Date
                        <br />
                        <telerik:RadCalendar AutoPostBack="false" ID="calE" runat="server" EnableMultiSelect="false">
                        </telerik:RadCalendar>
                    </td>
                    
                </tr>
               <asp:Panel runat="server" ID="pnlmsg">
               <tr>
                    <td colspan="3">
                        <small><u class="ErrorText">Note:</u> only dates in blue color are valid dates having commercial's data.</small>
                    </td>
                </tr>
                </asp:Panel>
            </table>
        </td> 
    </tr>

    <tr>
        <td colspan="2"><br /><br /><b>Media</b><br /><br /></td>
    </tr>



    <tr valign="top">
        <td>Media Type</td>
        <td>
            <asp:DropDownList ID="lstMediaType"  runat="server"
                AutoPostBack="true" DataValueField="MediaTypeCode" 
                DataTextField="MediaTypeName" 
                onselectedindexchanged="lstMediaType_SelectedIndexChanged"   /><br /><br />
               
        </td>
    </tr>
    
    
    <tr valign="top" >
        <td style="width:15%;">
            Channel / Media Name
        </td>
        <td style="font-size: small;">
         
            <asp:CheckBox ID="chkAllMedia" runat="server" AutoPostBack="true" OnCheckedChanged="chkAllMedia_CheckedChanged" Text="Search from all Media Channels"
                Checked="true"  />
            <div id="dvMediaList" runat="server" visible="false" class="Box">
                <asp:CheckBoxList ID="lstMedia" runat="server" DataValueField="MediaCode" DataTextField="MediaName"
                    RepeatColumns="3" RepeatDirection="Horizontal" Font-Size="8px" 
                    AutoPostBack="True" onselectedindexchanged="lstMedia_SelectedIndexChanged">
                </asp:CheckBoxList>
                <asp:DropDownList style="margin-left:458px; float:left;margin-bottom:4px; margin-top:-21px;" ID="drpAvenueCOunt" Visible="false" runat="server" 
                    AutoPostBack="True" 
                    onselectedindexchanged="drpAvenueCOunt_SelectedIndexChanged">
                <asp:ListItem Text="1" Value="1" Selected="True"></asp:ListItem>
                  <asp:ListItem Text="2" Value="2" ></asp:ListItem>
                  <asp:ListItem Text="3" Value="3" ></asp:ListItem>
                  <asp:ListItem Text="4" Value="4" ></asp:ListItem>
                  <asp:ListItem Text="5" Value="5" ></asp:ListItem>
                  <asp:ListItem Text="6" Value="6" ></asp:ListItem>
                  <asp:ListItem Text="7" Value="7" ></asp:ListItem>
                  <asp:ListItem Text="8" Value="8" ></asp:ListItem>
                  <asp:ListItem Text="9" Value="9" ></asp:ListItem>
                  <asp:ListItem Text="10" Value="10" ></asp:ListItem>
                </asp:DropDownList>
            </div>
             <asp:Panel runat="server" ID="PanelRandomCntrolsHolder" Width="100%"></asp:Panel>
             <%-- <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>--%>
          <asp:Panel runat="server" ID="pnlTest" Width="100%"></asp:Panel>
        </td>
    </tr>

   
 
        <tr>
        <td colspan="2">
            <br /><b>Products</b><br /><br />
        </td>
    </tr>
   
        <tr>
        <td colspan="2">
        
                
                
            <table>            
                <tr valign="top" >
                    <td style="width: 133px;">Sector</td>
                    <td>
                    <asp:DropDownList ID="lstSector" runat="server" AutoPostBack="true" OnSelectedIndexChanged="lstSector_Changed" DataTextField="SectorName" DataValueField="SectorID" />
                </td>
            
                </tr>
                <tr>
                <td>Sub Sector</td>
                <td>
                    <asp:DropDownList ID="lstSubSector" runat="server" AutoPostBack="true" OnSelectedIndexChanged="lstSubSector_Changed"
                        DataTextField="SubSectorName" DataValueField="SubSectorID" />
                        <br />
                </td>
            </tr>
                <tr style='display: <%=AppUser.GetCountry()==177 ? "table-row": "none" %>'>
                    <td>
                    Sub Sector 2
                </td>
                    <td>
                        <asp:DropDownList ID="lstSubSector2" runat="server" AutoPostBack="true" OnSelectedIndexChanged="lstSubSector_Changed"
                            DataTextField="SubSectorName" DataValueField="SubSectorID" />
                    <br />
                </td>
                </tr>
                <tr >
                <td>Category</td>
                <td>
                    <asp:DropDownList ID="lstCategory" runat="server"
                        DataTextField="CategoryName" DataValueField="CategoryID" />
                </td>
            </tr>
             <tr>
                    <td colspan="2">
                        <br /><br / >
                    </td>
                </tr>
                <tr>
                    <td>
                        Advertiser
                    </td>
                    <td>
                        <asp:DropDownList ID="lstAdvertiser" runat="server"
                            DataTextField="AdvertiserName" DataValueField="AdvertiserID" />
                    </td>
                </tr>
                <tr id="RowAgency" runat="server">
                    <td>
                        Agency
                    </td>
                    <td>
                        <asp:DropDownList ID="lstAgency" runat="server" DataTextField="AgencyName"
                            DataValueField="AgencyID" />
                    </td>
                </tr>
            

            </table>
          
        </td>
    </tr>
        
        <tr>
            <td colspan="2">
                <br />
                <br />
            </td>
        </tr>
       
        <tr>
            <td>
               Product
            </td>
            <td>
                <ctrl:AutoComplete ID="acBrand" runat="server" MinimumPrefixLength="2"  
                    ServicePath="~/users/report-outdoor-filter.aspx" ServiceMethod="AutoComplete_FillBrand"
                   completionsetcount="10" />
            </td>
        </tr>

         <tr id="RowNegotiatedPrice" runat="server" visible="false">
            <td>
               Negotiated Price($)
            </td>
            <td>
            <asp:TextBox runat="server"  ID="txtnEGOTIATEDpRICE"></asp:TextBox>
            </td>
        </tr>
        <tr style="display:none;">
            <td>
                Product
            </td>
            <td>
                <ctrl:AutoComplete ID="acProduct" runat="server" MinimumPrefixLength="2"  
                    ServicePath="~/users/report-outdoor-filter.aspx" ServiceMethod="AutoComplete_FillProduct"
                    completionsetcount="10" />
            </td>
        </tr>
        <tr id="RowVersion" runat="server">
        <td>
            Version
        </td>
        <td>
            <ctrl:AutoComplete ID="acVersion" runat="server" MinimumPrefixLength="2" ServicePath="~/users/report-outdoor-filter.aspx"
                ServiceMethod="AutoComplete_FillVersion" completionsetcount="10" />
        </td>
    </tr>
        <tr style="display:none;" id="RowOptionStartTime" runat="server">
            <td colspan="4">
                <br />
                <br />
                <b>Options</b><br /><br /></td>
            <td colspan="3">
                <tr>
                    <td>
                        Start Time
                    </td>
                    <td colspan="3">
                        <asp:DropDownList ID="lstStartTime" runat="server">
                            <asp:ListItem Value="0">Any</asp:ListItem>
                            <asp:ListItem Value="20000">02:00</asp:ListItem>
                            <asp:ListItem Value="30000">03:00</asp:ListItem>
                            <asp:ListItem Value="40000">04:00</asp:ListItem>
                            <asp:ListItem Value="50000">05:00</asp:ListItem>
                            <asp:ListItem Value="60000">06:00</asp:ListItem>
                            <asp:ListItem Value="70000">07:00</asp:ListItem>
                            <asp:ListItem Value="80000">08:00</asp:ListItem>
                            <asp:ListItem Value="90000">09:00</asp:ListItem>
                            <asp:ListItem Value="100000">10:00</asp:ListItem>
                            <asp:ListItem Value="110000">11:00</asp:ListItem>
                            <asp:ListItem Value="120000">12:00</asp:ListItem>
                            <asp:ListItem Value="130000">13:00</asp:ListItem>
                            <asp:ListItem Value="140000">14:00</asp:ListItem>
                            <asp:ListItem Value="150000">15:00</asp:ListItem>
                            <asp:ListItem Value="160000">16:00</asp:ListItem>
                            <asp:ListItem Value="170000">17:00</asp:ListItem>
                            <asp:ListItem Value="180000">18:00</asp:ListItem>
                            <asp:ListItem Value="190000">19:00</asp:ListItem>
                            <asp:ListItem Value="200000">20:00</asp:ListItem>
                            <asp:ListItem Value="210000">21:00</asp:ListItem>
                            <asp:ListItem Value="220000">22:00</asp:ListItem>
                            <asp:ListItem Value="230000">23:00</asp:ListItem>
                            <asp:ListItem Value="240000">24:00</asp:ListItem>
                            <asp:ListItem Value="250000">25:00</asp:ListItem>
                            <asp:ListItem Value="260000">26:00</asp:ListItem>
                        </asp:DropDownList>
                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        End Time &nbsp; &nbsp;
                        <asp:DropDownList ID="lstEndTime" runat="server">
                            <asp:ListItem Value="0">Any</asp:ListItem>
                            <asp:ListItem Value="20000">02:00</asp:ListItem>
                            <asp:ListItem Value="30000">03:00</asp:ListItem>
                            <asp:ListItem Value="40000">04:00</asp:ListItem>
                            <asp:ListItem Value="50000">05:00</asp:ListItem>
                            <asp:ListItem Value="60000">06:00</asp:ListItem>
                            <asp:ListItem Value="70000">07:00</asp:ListItem>
                            <asp:ListItem Value="80000">08:00</asp:ListItem>
                            <asp:ListItem Value="90000">09:00</asp:ListItem>
                            <asp:ListItem Value="100000">10:00</asp:ListItem>
                            <asp:ListItem Value="110000">11:00</asp:ListItem>
                            <asp:ListItem Value="120000">12:00</asp:ListItem>
                            <asp:ListItem Value="130000">13:00</asp:ListItem>
                            <asp:ListItem Value="140000">14:00</asp:ListItem>
                            <asp:ListItem Value="150000">15:00</asp:ListItem>
                            <asp:ListItem Value="160000">16:00</asp:ListItem>
                            <asp:ListItem Value="170000">17:00</asp:ListItem>
                            <asp:ListItem Value="180000">18:00</asp:ListItem>
                            <asp:ListItem Value="190000">19:00</asp:ListItem>
                            <asp:ListItem Value="200000">20:00</asp:ListItem>
                            <asp:ListItem Value="210000">21:00</asp:ListItem>
                            <asp:ListItem Value="220000">22:00</asp:ListItem>
                            <asp:ListItem Value="230000">23:00</asp:ListItem>
                            <asp:ListItem Value="240000">24:00</asp:ListItem>
                            <asp:ListItem Value="250000">25:00</asp:ListItem>
                            <asp:ListItem Value="260000">26:00</asp:ListItem>
                        </asp:DropDownList>

                        <asp:CompareValidator ID="cvTime" runat="server" ControlToValidate="lstEndTime" ControlToCompare="lstStartTime" Operator="GreaterThanEqual" Type="Integer" ErrorMessage="End Time must be greater" Display="Dynamic" />
                    </td>
                </tr>
            </td>
        </tr>
        <tr id="RowSize" runat="server">
            <td>
                Size:</td>
            <td colspan="3">
                <asp:DropDownList ID="lstSize" runat="server">                    
                </asp:DropDownList>
            </td>
        </tr>
        <tr id="RowQuality" runat="server">
            <td>
                Quality</td>
            <td colspan="3">
                <asp:DropDownList ID="lstQuality" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr id="RowTypeofAds" runat="server">
            <td>
                Type of Ads
            </td>
            <td>
                <asp:DropDownList ID="lstTypeOfAds" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr id="RowPriceFrom" runat="server">
            <td>
                Price From
            </td>
            <td colspan="3">
                <asp:TextBox ID="tbPriceFrom" runat="server" Width="80"></asp:TextBox>
                <asp:RangeValidator ID="rvPriceFrom" runat="server" 
                    ControlToValidate="tbPriceFrom" Display="Dynamic" ErrorMessage="Invalid price" 
                    MaximumValue="9999" MinimumValue="0" Text="Invalid price" Type="Currency" />
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Price To &nbsp; &nbsp;
                <asp:TextBox ID="tbPriceTo" runat="server" Width="80"></asp:TextBox>
                <asp:RangeValidator ID="rvPriceTo" runat="server" ControlToValidate="tbPriceTo" 
                    Display="Dynamic" ErrorMessage="Invalid price" MaximumValue="9999" 
                    MinimumValue="0" Text="Invalid price" Type="Currency" />
            </td>
        </tr> 

        <tr id="RowReportFields" runat="server">
            <td>Report Fields</td>
            <td colspan="3">
                <asp:CheckBoxList ID="lstFields" runat="server" RepeatLayout="Table" RepeatDirection="Horizontal" RepeatColumns="6">
                    <asp:ListItem Value="MediaTypeName">Media Type</asp:ListItem>
                    <asp:ListItem Value="MediaName" Selected="True">Media / Channel</asp:ListItem>
                    
                    <asp:ListItem Value="AgencyName">Agency</asp:ListItem>
                    <asp:ListItem Value="AdvertiserName" Selected="True">Advertiser</asp:ListItem>
                    <%--<asp:ListItem value="BrandName">Brand</asp:ListItem> --%>
                    <asp:ListItem Value="ProductName" Selected="True">Product</asp:ListItem>
                    <asp:ListItem Value="ProdVersionName">Version</asp:ListItem>

                    <asp:ListItem Value="SectorName">Sector</asp:ListItem>
                    <asp:ListItem Value="SubSectorName">SubSector</asp:ListItem>
                    <asp:ListItem Value="CategoryName">Category</asp:ListItem>

                    <asp:ListItem Value="Size">Size</asp:ListItem>
                   <%-- <asp:ListItem Value="Quality">Quality</asp:ListItem>
                    <asp:ListItem Value="TypeOfAds">Type of ads</asp:ListItem>--%>
                    <asp:ListItem Value="VisibilityCode">Visibility</asp:ListItem>
                    <asp:ListItem Value="CarrierCode">Carrier</asp:ListItem>
                    <asp:ListItem Value="BetweenAvenue">Between Avenue</asp:ListItem> 
                    <asp:ListItem Value="RealCost" Selected="True">Investment</asp:ListItem>

                   <%-- <asp:ListItem Value="TimeStartFormatted" Selected="True">Start Time</asp:ListItem>
                    <asp:ListItem Value="TimeEndFormatted">End Time</asp:ListItem>--%>
                    
                </asp:CheckBoxList>
            </td>
        </tr>

        <tr id="RowDownLoadAll" runat="server">
            <td></td>
           
            <td colspan="3">
                    <br />
                      <span style="font-size:10px;"> Download all the videos, audios, or images related to your:</span>
                    <br />
                      <asp:CheckBox ID="chkFirstAppearance" runat="server" Checked="false" Text="Show only the first appearance of commerical"  Visible="false"/>
                 <asp:CheckBox ID="chkDownload" runat="server" Checked="false" Text="category" Font-Bold="true"/>
                  &nbsp;
                  <asp:CheckBox ID="chkDownloadProduct" runat="server" Checked="false" Text="product" Font-Bold="true"/>
               &nbsp;
                   <asp:CheckBox ID="chkDownloadAdvertiser" runat="server" Checked="false" Text="advertiser" Font-Bold="true"/>
                </td>
        </tr>
     
        <tr>
            <td></td>
            <td>
          
           
                <asp:ImageButton ID="btnSearch" runat="server" OnClick="btnSearch_Click"  Visible="false" SkinID="Search"/>
                <asp:Button ID="btnSearch1" runat="server" Text="Run"  OnClick ="btnSearch1_Click"/>                
                <asp:ImageButton ID="btnSearchMap" Visible="false" runat="server" OnClick="btnSearch1_Click" SkinID="Map" />
                <asp:Button ID="btnSearchMap1" runat="server" Text="Map"  OnClick ="btnSearch1_Click"/>  
              
                        <asp:Label ID="lblErrorMsg" runat="server" Text="" ForeColor="red"></asp:Label>
                
                 
            </td>
        </tr> 
</table>

  </asp:Panel>
  
    </ContentTemplate>
   
    </asp:UpdatePanel>
     
     <asp:SqlDataSource ID="sqlDsSize" runat="server" ConnectionString="<%$ConnectionStrings:DBAdex %>" SelectCommand="SELECT DISTINCT Size FROM OutDoorLog ORDER BY Size" />
    <asp:SqlDataSource ID="sqlDsQuality" runat="server" ConnectionString="<%$ConnectionStrings:DBAdex %>"
        SelectCommand="SELECT DISTINCT Quality FROM OutDoorLog ORDER BY Quality" />
    <asp:SqlDataSource ID="sqlDsTypeOfAds" runat="server" ConnectionString="<%$ConnectionStrings:DBAdex %>"
        SelectCommand="SELECT DISTINCT TypeOfAds FROM OutDoorLog ORDER BY TypeOfAds" />
</asp:Content>



